//
//  MoreViewController.m
//  CheXunWang
//
//  Created by zhu lin on 12/28/11.
//  Copyright 2011 Zhulin. All rights reserved.
//

#import "MoreViewController.h"
#import "HomeViewController.h"

@implementation MoreViewController

// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
    [super viewDidLoad];
	
	self.title = @"更多";
    self.navigationItem.hidesBackButton = YES;
	
	UIButton *homeButton = [UIButton buttonWithType:UIButtonTypeCustom];
	homeButton.frame = CGRectMake(0.0f, 8.0f, 87.0f, 27.0f);
	[homeButton addTarget:self action:@selector(showHomeView:) forControlEvents:UIControlEventTouchUpInside];
	[homeButton setImage:[UIImage imageNamed:@"ios_common_titlebar_logo.png"] forState:UIControlStateNormal];
	self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:homeButton];
}

/*
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations.
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
*/

- (void)didReceiveMemoryWarning {
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc. that aren't in use.
}

- (void)viewDidUnload {
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}


- (void)dealloc {
    [super dealloc];
}

#pragma mark -
#pragma mark actions
- (void) showHomeView:(id)sender
{
	if (![NSThread isMainThread]) {
		[self performSelectorOnMainThread:@selector(showHomeView:) withObject:nil waitUntilDone:NO];
		return;
	}
	
	HomeViewController *homeVC = [HomeViewController sharedViewController];
	[self.navigationController presentModalViewController:homeVC animated:YES];
	//UINavigationController *nav = [[CheXunWangAppDelegate shareAppDelegate].tabbarController.viewControllers objectAtIndex:0];
	//[nav popToRootViewControllerAnimated:NO];
}

-(IBAction)showMySecretary:(id)sender
{

}

-(IBAction)showMyFavorites:(id)sender
{
	
}

-(IBAction)showNearestGasStation:(id)sender
{
	
}

-(IBAction)show4SInfo:(id)sender
{
	
}

-(IBAction)showAboutUs:(id)sender
{
	
}

-(IBAction)showFeedback:(id)sender
{
	
}
@end
